function [ ] = plotTensorField( domain2D, rx, ry, strain )
%PLOTDIRECTIONFIELD Summary of this function goes here
%   Detailed explanation goes here

px = [domain2D.vx];%; rx];
py = [domain2D.vy];%; ry];

n = size(px, 1);

pdir = zeros(n, 2);

for i = 1 : n
   [V, D] = eig(strain(:,:,i));
   [mv, index] = max(diag(D));
   mv = max(mv, 0);
   
   pdir(i, :) = V(:, index)' * mv * 10;    
end

figure;

quiver(px, py, pdir(:,1), pdir(:,2));

axis ( [ -1, 1, -1, 1] );
% caxis( [ 0, 1.7] );
axis square;

end

